package edu.neusoft.springhtmldemo.util;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
//图片路径转换器，浏览器不支持直接访问本地路径，使用转换器进行转换
@Configuration
public class MyWebConfig implements WebMvcConfigurer {
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/img/**").addResourceLocations("file:///C:/Users/NEUSOFT/Desktop/煤矿机器人项目/backCoding/springhtmldemo/src/main/resources/static/img/");
    }
}
